package com.isoft.bean;
public class UserContext {
    // 使用静态变量来共享数据
    private static String currentUserType;
    private static String descType;

    public static Integer currentNum = 1;

    // 使用锁对象来确保线程安全
    private static final Object lock = new Object();

    public static void setCurrentUserType(String userType) {
        synchronized (lock) {
            currentUserType = userType;
        }
    }

    public static String getCurrentUserType() {
        synchronized (lock) {
            return currentUserType;
        }
    }

    public static void setDescType(String description) {
        synchronized (lock) {
            descType = description;
        }
    }

    public static String getDescType() {
        synchronized (lock) {
            return descType;
        }
    }

    public static void clearCurrentUserType() {
        synchronized (lock) {
            currentUserType = null;
            descType = null;
        }
    }

}
